home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Source Code
/
Pascal
/
Code Resources
/
Eclectic CDEFs
/
CDEF Utilities
/
JumpCDEF Folder
/
JumpCDEFIntf.p
< prev
Wrap
Text File
|
1997-02-27
|
1KB
|
63 lines
{ JumpCDEFIntf }
{}
{ Interface for the JumpCDEF resource stub }
{}
{ Copyright © Sebastiano Pilla 1996 }
{ All rights reserved }
{ <mailto:case@tvol.it> }
{ Add this unit to your projects to have ability of debugging the CDEF in your favourite }
{ source level debugger. See the file JumpCDEF Info for documentation details }
unit JumpCDEFIntf;
interface
{ InstallCDEFUPP }
{}
{ Installs a real control definition procedure into the jump record }
{}
{ Entry: inControlDefProcPtr = pointer to the real control definition procedure }
{ Exit: function result = error code }
function InstallCDEFUPP (inControlDefProc: ControlDefProcPtr): OSErr;
implementation
const
kCDEFJumpResType = 'CJMP'; { resource type of the 'CJMP' resource }
kCDEFJumpResID = 128; { resource ID of the 'CJMP' resource }
type
CDEFJumpHandle = ^CDEFJumpPtr;
CDEFJumpPtr = ^CDEFJumpRec;
CDEFJumpRec = record
fRealDefUPP: ControlDefUPP;
end;
function InstallCDEFUPP (inControlDefProc: ControlDefProcPtr): OSErr;
var
jmpHdl: CDEFJumpHandle;
err: OSErr;
begin
jmpHdl := CDEFJumpHandle(GetResource(kCDEFJumpResType, kCDEFJumpResID));
err := ResError;
if (jmpHdl <> nil) and (err = noErr) then
begin
HLock(Handle(jmpHdl));
jmpHdl^^.fRealDefUPP := NewControlDefProc(inControlDefProc);
HUnlock(Handle(jmpHdl));
ChangedResource(Handle(jmpHdl));
HNoPurge(Handle(jmpHdl));
end;
InstallCDEFUPP := err;
end;
end.